package com.xiaoshuidi.cloud.module.member.service.enterprise;

import com.xiaoshuidi.cloud.framework.common.pojo.PageResult;
import com.xiaoshuidi.cloud.module.member.controller.admin.enterprise.vo.EnterpriseInfoRespVO;
import com.xiaoshuidi.cloud.module.member.controller.admin.enterprise.vo.EnterprisePageReqVO;
import com.xiaoshuidi.cloud.module.member.controller.admin.enterprise.vo.EnterpriseVO;
import com.xiaoshuidi.cloud.module.member.controller.app.enterprise.vo.EnterpriseCreateVO;
import com.xiaoshuidi.cloud.module.member.controller.app.user.vo.MemberVO;
import com.xiaoshuidi.cloud.module.member.repository.MemberEnterpriseRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.validation.Valid;

@Service
@Valid
@Slf4j
public class MemberEnterpriseServiceImpl implements MemberEnterpriseService {
    @Resource
    private MemberEnterpriseRepository memberEnterpriseRepository;

    @Override
    public Boolean createEnterprise(EnterpriseCreateVO vo) {
        memberEnterpriseRepository.createEnterprise(vo);
        return true;
    }

    @Override
    public PageResult<EnterpriseVO> getEnterprisePage(EnterprisePageReqVO vo) {
        PageResult<EnterpriseVO> page= memberEnterpriseRepository.getEnterprisePage(vo);
        return page;
    }

    @Override
    public EnterpriseInfoRespVO getEnterpriseInfoById(Long id) {
        return memberEnterpriseRepository.getEnterpriseInfoById(id);
    }
}
